Compiler Design
Q71.
Consider the following Syntax Directed Translation Scheme(SDTS),with non-terminals {S, A} and terminals {a, b}. S \rightarrow aA {print 1} S \rightarrow a { print 2} A \rightarrow Sb { print 3} Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:Q72.
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example, int a[10][3]; The grammars use D as the start symbol,and use six terminal symbols int ;id[]num. Which of the grammars correctly generate the declaration mentioned above?Q74.
Given the following expression grammar:E \rightarrow E * F|F+E| FF \rightarrow F-F \mid i dWhich of the following is true?Q77.
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals1. A \rightarrow B C2. A \rightarrow C c B b3. A \rightarrow B a C4. A \rightarrow \epsilonQ78.
Consider the following grammar.\mathrm{S} \rightarrow \mathrm{AB}\mathrm{A} \rightarrow \mathrm{a}\mathrm{A} \rightarrow \mathrm{BaB}\mathrm{B} \rightarrow \mathrm{bbA}Which of the following statements is FALSE?Q79.
Among simple LR (SLR) , canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful , in that order?Q80.
Consider the following grammar S \rightarrow F|H F \rightarrow p|c H \rightarrow d|c where S,F, and H are non-terminal symbols, p,d, and c are terminal symbols. Which of the following statement(s) is/are correct? S1. LL(1) can parse all strings that are generated using grammar G S2. LR(1) can parse all strings that are generated using grammar G